minor bugfix in cholla frontend#4686
Merged
neutrinoceros merged 2 commits intoyt-project:mainfrom Oct 26, 2023
Merged
Conversation
Previously, the ``domain_right_edge`` attribute of ``ChollaDataset`` was initialized by assigning it the values of the ``"domain"`` attribute stored in the hdf5 file. This patch adjusts the logic so that the ``domain_right_edge`` attribute is now the sum of that array and the array stored in the ``domain_left_edge`` attribute.
Member
|
Great catch. |
matthewturk
previously approved these changes
Oct 5, 2023
Comment on lines
+106
to
+108
| self.domain_right_edge = self.domain_left_edge + attrs["domain"][:].astype( | ||
| "=f8" | ||
| ) |
Member
There was a problem hiding this comment.
This is one of the rare cases where black makes things objectively worse looking... here's a possible alternative
Suggested change
| self.domain_right_edge = self.domain_left_edge + attrs["domain"][:].astype( | |
| "=f8" | |
| ) | |
| dre = attrs["bounds"][:] + attrs["domain"][:] | |
| self.domain_right_edge = dre.astype("=f8") |
Member
|
Ok since Cameron is happy, I think we can ignore my style nit and merge as in. Thanks everyone ! |
meeseeksmachine
pushed a commit
to meeseeksmachine/yt
that referenced
this pull request
Oct 26, 2023
Contributor
Author
|
@neutrinoceros - sorry about not addressing that style change (I agree that your version looks better). The last few weeks have been a little hectic. I may try to implement that change in #4702 (since I'm already touching nearby code) |
Member
|
No worries, we use linters and formatters mainly so we can not discuss style nits and focus on what's actually important ;-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Previously, the
domain_right_edgeattribute ofChollaDatasetwas initialized by assigning it the values of the"domain"attribute stored in the hdf5 file. This patch adjusts the logic so that thedomain_right_edgeattribute is now the sum of that array and the array stored in thedomain_left_edgeattribute.PR Checklist
Given the simplicity of this fix, I don't really think there's any need for new documentation. Plus adding a test is probably not worth the effort (we would need to either introduce a new cholla dataset OR duplicate and mutate the existing dataset).